﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Cxx.BLL;
using Cxx.Common;

namespace Cxx.OrderManagerSys
{
    public partial class HistoryTotal : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                BindData();
            }
        }

        private void BindData()
        {
            string condition = MyWebHelper.SelectKey(pnlSearch, out _);
            var list = CusTotalLogs.GetListForPage(condition, pager.CurrentPageIndex, pager.PageSize, out var recordCount);
            pager.RecordCount = recordCount;
            rptOrderList.DataSource = list;
            rptOrderList.DataBind();
        }

        protected void btBrowse_Click(object sender, EventArgs e)
        {
            BindData();
        }

        /// <summary>
        /// 翻页
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void pager_PageIndexChange(object sender, EventArgs e)
        {
            BindData();
        }
    }
}